package com.github.lee.unsplash.model.api

import androidx.annotation.IntRange
import com.github.lee.unsplash.domain.PhotoBean
import com.github.lee.unsplash.domain.response.BaseResult
import retrofit2.http.*

interface PhotoApi {

    @GET("photos")
    suspend fun listPhotos(
        @Query("page") page: Int,
        @Query("per_page") size: Int? = 10,
        @Query("order_by") orderBy: String?,
    ): BaseResult<List<PhotoBean>>

    @GET("photos/random")
    suspend fun randomListPhotoList(
        @IntRange(from = 1, to = 30) @Query("count") count: Int,
        @Query("collections") collections: String? = null,
        @Query("username") username: String? = null,
        @Query("orientation") orientation: String? = null,
        @Query("content_filter") content_filter: String? = null,
    ): BaseResult<List<PhotoBean>>

    @GET("photos/random")
    suspend fun randomOnePhoto(
        @Query("collections") collections: String? = null,
        @Query("username") username: String? = null,
        @Query("orientation") orientation: String? = null,
        @Query("content_filter") content_filter: String? = null,
    ): BaseResult<PhotoBean>


    @POST("photos/{id}/like")
    suspend fun likePhoto(@Path("id") id: String): BaseResult<PhotoBean>
    @DELETE("photos/{id}/like")
    suspend fun unlikePhoto(@Path("id") id: String): BaseResult<PhotoBean>

}